columnviewlayout: Use header allocation for titles
authorMatthias Clasen <mclasen@redhat.com>
Fri, 20 Dec 2019 22:28:37 +0000 (17:28 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 3 Jun 2020 17:31:39 +0000 (13:31 -0400)
Normally, this will be identical to the column
allocation, but we will temporarily change it
during column reordering.

gtk/gtkcolumnviewlayout.c

index c4ba28a112b9ca3dd5558f22a252b86b384072a3..05f218c52503d96e4b54aa78d9361f1b4897fe59 100644 (file)
@@ -118,11 +118,16 @@ gtk_column_view_layout_allocate (GtkLayoutManager *layout_manager,
       int col_x, col_width;
 
       if (GTK_IS_COLUMN_VIEW_CELL (child))
-        column = gtk_column_view_cell_get_column (GTK_COLUMN_VIEW_CELL (child));
+        {
+          column = gtk_column_view_cell_get_column (GTK_COLUMN_VIEW_CELL (child));
+          gtk_column_view_column_get_allocation (column, &col_x, &col_width);
+        }
       else
-        column = gtk_column_view_title_get_column (GTK_COLUMN_VIEW_TITLE (child));
+        {
+          column = gtk_column_view_title_get_column (GTK_COLUMN_VIEW_TITLE (child));
+          gtk_column_view_column_get_header_allocation (column, &col_x, &col_width);
+        }
 
-      gtk_column_view_column_get_allocation (column, &col_x, &col_width);
       gtk_widget_size_allocate (child, &(GtkAllocation) { col_x, 0, col_width, height }, baseline);
     }
 }